package cn.chrilwe.pigpig.im.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import cn.chrilwe.pigpig.im.rabbit.common.RabbitConfiguration;
import cn.chrilwe.pigpig.im.rabbit.factory.RabbitSessionFactory;
import cn.chrilwe.pigpig.im.rabbit.factory.impl.RabbitSessionFactoryBean;

@Configuration
public class RabbitConfig {

	@Bean
	public RabbitSessionFactory rabbitSessionFactory() {
		RabbitConfiguration config = new RabbitConfiguration();
		config.setConnectionTimeout(1000);
		config.setHost("192.168.43.163");
		config.setPort(5672);
		config.setUsername("guest");
		config.setPassword("guest");
		config.setVirtual_host("/");
		RabbitSessionFactoryBean factory = new RabbitSessionFactoryBean(config);
		return factory.getFactory();
	}
	
}
